﻿using System.Threading;

namespace H.Kernel.Login
{
    /// <summary>
    /// 登录接口
    /// </summary>
    public interface ILogin
    {
        /// <summary>
        /// 读取或设置启动器路径
        /// </summary>
        string StarterPath { get; set; }

        /// <summary>
        /// 读取或设置自动登录的用户名
        /// </summary>
        string UserName { get; set; }

        /// <summary>
        /// 读取或设置自动登录的密码
        /// </summary>
        string Password { get; set; }

        /// <summary>
        /// 读取或设置需要登录的区服(如果存在标点,全部用半角标点符号)
        /// </summary>
        string Region { get; set; }

        /// <summary>
        /// 最后一次执行失败时反馈的错误信息
        /// </summary>
        string ErrorMessage { get; }

        /// <summary>
        /// 开始登录操作
        /// </summary>
        /// <param name="ct"></param>
        /// <returns></returns>
        bool Login(CancellationToken ct);

    }
}
